using System;

namespace Kannon.Core
{
    internal class RouteHandlerDescriptor
    {
        public string Url
        { get; private set; }

        public Predicate<KannonRequest> Filter
        { get; private set; }

        public Func<KannonRequest, KannonResponse> Handler
        { get; private set; }

        public RouteHandlerDescriptor(string url, Func<KannonRequest, KannonResponse> handler)
        {
            Url = url;
            Handler = handler;
        }

        public RouteHandlerDescriptor(string url, Predicate<KannonRequest> filter, Func<KannonRequest, KannonResponse> handler)
        {
            Url = url;
            Filter = filter;
            Handler = handler;
        }
    }
}